module.exports = app => {
    const mongoose = app.mongoose;
    const RecordSchema = new mongoose.Schema({
        code: String,
        owner: String,
        wxInfo: {
            openid: String,
            nickname: String,
            headimgurl: String,
            sex: Number,
            country: String,
            province: String,
            city: String
        },
        fee: Number,
        name: String,
        remark: String,
        status: Number,
        updateDate: { type: Date, default: new Date() },
        createDate: { type: Date, default: new Date() },
        place: {
            id:String,
            code:String,
            name:String,
            userId:String
        }
    },
        { collection: 'money_record' })

    return mongoose.model('Record', RecordSchema);
}